<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="entity.Student"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>El.jsp</title>
</head>
<body>
	<%
	// 1.普通票字符串
	pageContext.setAttribute("student_name","zhangsan");
	request.setAttribute("student_name", "list");
	// 2.Studen对象
	Student student = new Student(1,"王五",23,"男");
	session.setAttribute("student", student);
	// 3.List<Student>
	List<Student> list = new ArrayList<Student>();
	Student student1 = new Student(1,"赵柳",23, "男");
	Student student2 = new Student(1, "老六2", 23, "男");
	Student student3 = new Student(1, "赵六3", 23, "男");
	list.add(student1);
	list.add(student2);
	list.add(student3);
	application.setAttribute("list", list);
	%>
	<!-- 1.获取普通字符串 -->
	<!-- 使用JSP表达式 -->
	<%=pageContext.getAttribute("student_name") %><br/>
	<%=request.getAttribute("student_name") %><br/>
	<%=pageContext.findAttribute("student_name") %>
	<!-- 使用EL表达式 -->
	${pageScope.student_name}<br/>
	${requestScope.student_name}<br/>
	${student_name}<br/>
	<hr/>
	
	<!-- 2.Student对象 -->
	<!-- 使用JSP表达式 -->
	<%
		Student stu = (Student)session.getAttribute("student");
	%>
	<%=stu.getStudent_name()%>
	<%=stu.getStudent_age()%><br/>
	<!-- 使用EL表达式 -->
	${sessionScope.student.student_name}
	${student.student_age}
	
	<hr/>
	
	
	<!-- 3.List<Student> -->
	<!-- 使用JSP表达式 -->
	<%
		List<Student> stuList = (List<Student>)application.getAttribute("list");
	%>
	
	<%=stuList.get(1).getStudent_name()%><br/>
	<!-- 使用EL表达式 -->
	${applicationScope.list[1].student_name}
	${list[1].student_age}
</body>
</html>